import java.util.*;
class Main
{	
	public static void main(String[] args){
		Bill b1=new Bill();
		int i=0,op;
		String ch="yes",itemCode,itemName;
		float total=0,price;
		Scanner sc=new Scanner(System.in);
		System.out.println("Menu\n1.Add Items\n2.Delete Items\n3.Generate Bill\n4.Exit");
		System.out.println("Enter option");
		op=sc.nextInt();
		while(op!=4){
		
			switch(op){
				case 1:
					while(ch.equals("yes")){
					System.out.println("Enter Code");
					itemCode=sc.next();
					System.out.println("Enter Item Name");
					itemName=sc.next();
					System.out.println("Enter price");
					price=sc.nextFloat();
					System.out.println("Want to add a new item");
					ch=sc.next();
					b1.addItem(itemCode,itemName,price);		
					}
					break;
			
				case 2: ch="yes";
					while(ch.equals("yes")){
					System.out.println("Enter item code");
					b1.deleteItem(sc.next());
					System.out.println("Want to delete more");
					ch=sc.next();
					}
					break;
				
				case 3:
					System.out.println("CODE\tNAME\tPRICE");
					System.out.println(b1.displayBill());
					System.out.println("No.Of.Items:"+b1.noOfItems());
					System.out.println("Total Amount:"+b1.getAmount());
					break;
			
				case 4:System.exit(0);
					break;
				
			}
			System.out.println("Enter choice");
			op=sc.nextInt();
	
		}		
	}
}
